//
//  MESelectableCollectionItem.m
//  MapEditor
//
//  Created by Eric on 3/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "MESelectableCollectionItem.h"

@implementation MESelectableCollectionItem
-(void)setSelected:(BOOL)flag {
    [super setSelected:flag];
    // tell the view that it has been selected
    MESelectableView* theView = (MESelectableView* )[self view];
    if([theView isKindOfClass:[MESelectableView class]]) {
        [theView setSelected:flag];
        [theView setNeedsDisplay:YES];     
    }
}

@end

@implementation MESelectableView
@synthesize selected;
-(void)drawRect:(NSRect)rect {
    if([self selected]) {
        [[NSColor grayColor] set];
        NSFrameRect(NSInsetRect([self bounds], 1.0, 1.0));    
    }
    [super drawRect:rect];
}


@end